// Moves the agents with basic flock rules
kernel void messageKernel(	global float4 *agents,
							global float4 *groupingOptions,
							global float4 *message,
							global float2 *originalID,
							int agents_mesh_width){
								
	unsigned int x = get_global_id(0);
	unsigned int y = get_global_id(1);
	
	if( x * y > agents_mesh_width * agents_mesh_width )
		return;
		
	float4 pos 			= agents[y * agents_mesh_width + x];
	float2 posID 		= originalID[y * agents_mesh_width + x];
	float4 groupOptions = groupingOptions[(int)(posID.y * agents_mesh_width + posID.x)];
	
	float isLeader = groupOptions.x;
	float myGroup = groupOptions.y;
	float groupSize = groupOptions.z;
	
	if( isLeader == 1.0f  && groupSize > 1.0f)
		message[(int)myGroup] = pos;
}